<?
die("Not used. Use import_tasks.php!");

session_start();
include 'funktionen.inc.php';

//http://www.php-resource.de/tutorials/read/38/6/

echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="cs">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=windows-1250">
    
     <link rel="stylesheet" type="text/css" href="css/css.css">
   <title>Backend - Aufgabe hinzuf&uuml;gen</title>
  </head>
  <body>
      <h1>Backend - Aufgabe hinzuf&uuml;gen</h1>';


if (!logged_in() or ($_SESSION['role']!="admin"))
die("nein.");
else
include 'header.php';

if (isset($_POST['add']))
{
	$sql="INSERT INTO `tasks` (
`id` ,
`title` ,
`source` ,
`comment`
)
VALUES (
NULL , '".htmlentities($_POST['title'])."', '".htmlentities($_POST['source'])."', '".htmlentities($_POST['comment'])."'
);";
	mysql_query($sql);
	echo '<h3>Aufgabe "'.htmlentities($_POST['title']).'" hinzugef&uuml;gt</h3><br><a href="add_task.php">Weitere Aufgabe hinzuf&uuml;gen</a>';
	//anlegen, mailen;
}
else
echo '<form method="post" action="add_task.php">
        <label>Aufgabentitel:</label><input name="title" type="text"><br>
        <label>Original: </label><textarea cols="50" rows="20" name="source"></textarea><br>
        <label>Kommentar: </label><textarea cols="50" rows="20" name="comment"></textarea><br><br>

        <input name="add" type="submit" value="Aufgabe hinzuf&uuml;gen">
    </form>';

include 'footer.php';
echo '</body></html>';
?>